import {debounce} from "./utils";

export const itemlistenerMixin = {
  components:{},
  data(){
    return{
      itemImgListener:null
    }
  },

  mounted(){
    // console.log('mixin');
    const refresh = debounce(this.$refs.scroll.refresh,200)
    this.itemImgListener = ()=>{
      refresh()
    }

    this.$bus.$on('imageloaded',this.itemImgListener)

  }


}

import BackTop from "../components/common/backtop/BackTop";
export const backtopMixin = {
  components: {
    BackTop
  },
  data(){
    return{
      backtopshow:false
    }

  },
  mounted() {

  },
  methods:{
    back2top(){

      this.$refs.scroll.backtotop(0,0)

    },
    backposlistener(pos){
      if(pos > 1000)
      {
        this.backtopshow = true
      }
      else {
        this.backtopshow = false
      }
    },
  }


}
